package com.film.rowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.film.domain.Film;
import com.film.domain.FilmOffice;
import com.film.domain.FilmShowings;

/*处理电影场次添加操作
 * 6.17 22.19*/
public class FilmShowingsRowMapper implements RowMapper<FilmShowings>{

	@Override
	public FilmShowings mapRow(ResultSet res, int i) throws SQLException {
		FilmShowings showings = new FilmShowings();
		
		Film film = new Film();
		film.setFilmId(res.getInt("film_id"));
		showings.setFilm(film);
		
		showings.setShowingsDay(res.getString("showings_day"));
		showings.setShowingsStartTime(res.getString("showings_starttime"));
		showings.setShowingsEndTime(res.getString("showings_endtime"));
		
		FilmOffice office = new FilmOffice();
		office.setOffId(res.getInt("off_id"));
		showings.setFilmOffice(office);
		
		showings.setShowingsPrice(res.getDouble("showings_price"));
		showings.setShowingsCreateTime(res.getString("showings_createTime"));
		showings.setShowingsUpdateTime(res.getString("showings_updateTime"));
		showings.setIsDelete(res.getInt("is_delete"));
		return showings;
	}
	
}
